package June12;

import java.util.Scanner;

public class CalculatorTest {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		Calculator p1 = new Calculator();
		p1.brand = "步步高";
		p1.color = "五颜六色";
		p1.price = 50;

		int coo = 0;
		while (true) {
			System.out.println("1、加.\n2、减.\n3、乘.\n4、除.\n5、立方计算.\n6、退出;");
			System.out.println("请输入您要进行的操作:");
			coo = input.nextInt();
			if (coo == 1) {
				System.out.println("请输入第一个数：");
				double num1 = input.nextDouble();
				System.out.println("请输入第二个数：");
				double num2 = input.nextDouble();
				double plus = p1.plus(num1, num2);
				System.out.println(num1 + "+" + num2 + "=" + plus);
			}
			if (coo == 2) {
				System.out.println("请输入第一个数：");
				double num1 = input.nextDouble();
				System.out.println("请输入第二个数：");
				double num2 = input.nextDouble();
				double subtract = p1.subtract(num1, num2);
				System.out.println(num1 + "-" + num2 + "=" + subtract);
			}
			if (coo == 3) {
				System.out.println("请输入第一个数：");
				double num1 = input.nextDouble();
				System.out.println("请输入第二个数：");
				double num2 = input.nextDouble();
				double multiply = p1.multiply(num1, num2);
				System.out.println(num1 + "*" + num2 + "=" + multiply);
			}
			if (coo == 4) {
				System.out.println("请输入第一个数：");
				double num1 = input.nextDouble();
				System.out.println("请输入第二个数：");
				double num2 = input.nextDouble();
				double devide = p1.divide(num1, num2);
				System.out.println(num1 + "/" + num2 + "=" + devide);
			}
			if (coo == 5) {
				System.out.println("请输入第一个数：");
				double num1 = input.nextDouble();
				double stere = p1.stere(num1);
				System.out.println(num1 + "的立方是" + stere);
			}
			if (coo == 6) {
				break;
			}
			if (coo <= 0 || coo > 6) {
				break;
			}
		}
	}
}
